/*global nw:true, window */

"use strict";

window.nw = window.nw || {};

nw.Sandbox = function(core) {
    this._dom = core.getPlugin('dom');
    this._template = core.getPlugin('template');
	this._core = core;
};

nw.Sandbox.prototype = {
    find: function(selector) {
        return this._dom._findBySelector(selector);
    },
    getValue: function(input) {
        return this._dom.getValue(input);
    },
    setValue: function(input, value) {
        this._dom.setValue(input, value);
    },
    show: function(input) {
        this._dom.show(input);
    },
    hide: function(input) {
        this._dom.hide(input);
    },
    render: function(selector, view, model) {
        this._template.render(selector, view, model);
    },
	getCurrentViewName: function() {
		return this._core.currentViewName;
	},
    views: function() {
        return this._core.views();
    },
    goView: function(viewName) {
        this._core.goView(viewName);
    },
    onClick: function(input, handler) {
        return this._dom.bind(input, "click", handler);
    }
};